<html>
<head><meta charset="utf-8"><title>proc macro NixOS patching · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/proc.20macro.20NixOS.20patching.html">proc macro NixOS patching</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216911566"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/proc%20macro%20NixOS%20patching/near/216911566" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/proc.20macro.20NixOS.20patching.html#216911566">(Nov 16 2020 at 18:26)</a>:</h4>
<p>I'm getting this error when using a proc. macro:</p>
<div class="codehilite"><pre><span></span><code>error: /nix/store/2pi6zgkwnr3zdslvlv16nixpzvbyjx1n-glibc-2.31/lib/libc.so.6: version `GLIBC_2.32&#39; not found (required by /home/jonas/dev/app-template-test/target/debug/deps/libdefmt_macros-be393df45b201b51.so)
  --&gt; /home/jonas/.cargo/registry/src/github.com-1ecc6299db9ec823/defmt-0.1.1/src/lib.rs:42:9
   |
42 | pub use defmt_macros::intern;
   |         ^^^^^^^^^^^^

error: aborting due to previous error

error: could not compile `defmt`.
</code></pre></div>
<p>I'm on an Arch Linux system that has Nix installed, and it seems that rustc is linking against glibc from Nix for some reason. Does rustc have any Nix(OS) detection that could erroneously kick in here?</p>



<a name="216912129"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/proc%20macro%20NixOS%20patching/near/216912129" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/proc.20macro.20NixOS.20patching.html#216912129">(Nov 16 2020 at 18:30)</a>:</h4>
<p>Hmm, I might have installed Rust via Nix rustup instead of Arch rustup</p>



<a name="216912146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/proc%20macro%20NixOS%20patching/near/216912146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/proc.20macro.20NixOS.20patching.html#216912146">(Nov 16 2020 at 18:30)</a>:</h4>
<p>Cursed. I need to fix my setup.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>